import com.alibaba.fastjson2.JSON;
import lombok.extern.slf4j.Slf4j;
import model.Finance;
import util.Sqlite;

import java.util.List;
import java.util.Map;

@Slf4j
public class Stock {
    /**
     * @return 股票基本信息
     */
    public static List<String> listStockInfo() {
        List<Map<String, Object>> list = Sqlite.getFinanceObject();
        return list.stream().map(
                map -> {
                    Finance f = JSON.parseObject(JSON.toJSONString(map), Finance.class);
                    return f.toString();
                }
        ).toList();
    }

    public static void main(String[] args) {
        listStockInfo().forEach(
                log::info
        );
    }
}